//生产
//window.base_url = 'https://hapi.giventoday.cn/huij-hapi';
//测试
//window.base_url = 'http://yb.5dhj.com:16080/huij-hapi';
//本地
window.base_url = 'http://172.16.2.132:8082';

document.write("<script src='../../../js/jquery.md5.js' type='text/javascript'></script>");
var $$ = jQuery.noConflict();
console.log("name>>>>>>>>>"+sessionStorage.getItem('name'));
console.log("mobile>>>>>>>>>"+sessionStorage.getItem('mobile'));
console.log("creSn>>>>>>>>>"+sessionStorage.getItem('creSn'));
console.log("userName>>>>>>>>>"+sessionStorage.getItem('userName'));

var time_mills;
var mac_key = sessionStorage.getItem('mac_key');
function generateMac() {
	var $$ = jQuery.noConflict();
	time_mills = new Date().getTime();
	var length = mac_key.length - 10;
	var index = (time_mills*1) % length;
	var key = mac_key.substring(index, mac_key.length);
	var mac = $$.md5(key);
	return mac;
}
$$(function($) {
	// 备份jquery的ajax方法    
	var _ajax = $.ajax;
	// 重写ajax方法，先判断登录在执行success函数   
	$.ajax = function(opt) {
		mac_key = sessionStorage.getItem('mac_key');
		if(!isNull(mac_key)){//拼接公共参数
			var token = sessionStorage.getItem('token');
			var channel_mac = sessionStorage.getItem('channel_mac');
			var creSn =  sessionStorage.getItem('creSn');
			if(isNull(token))token ="";
			if(isNull(channel_mac))channel_mac ="";
			if(isNull(creSn))creSn ="";
			if(opt.url.split("?").length==2){
				opt.url = opt.url+"&mac="+generateMac()+"&time_mills="+time_mills+"&channel_mac="+channel_mac+"&cooperator_user_id="+creSn+"&token="+token;
			}else{
				opt.url = opt.url+"?mac="+generateMac()+"&time_mills="+time_mills+"&channel_mac="+channel_mac+"&cooperator_user_id="+creSn+"&token="+token;
			}
			//console.log(opt)
		}
		console.log(opt)
		var _success = opt && opt.success || function(a, b) {};
		var _error = opt && opt.error || function(a, b) {
			var resp_msg;
			if(a.responseText) {
				var resps = a.responseText.split(',');
				for(var i in resps) {
					if(resps[i].indexOf('resp_msg') > -1) {
						resp_msg = resps[i].split(":")[1];
						break;
					}
				}
			}
			_errors();
		};
		var _opt = $.extend(opt, {
			success: function(data, textStatus) {
				console.log(data)
				// 如果token失效则返回到登录页
				if(data.resp_result == 'token_fail') {
					hide();
					//window.location.href='../cash/fail.html';
				}else if(data.resp_result == 'mac_fail'){
					//location.href = '../cash/fail.html';
				}else {
					_success(data, textStatus);
				}
			},
			error: _error
		});
		return _ajax(_opt);
	};
});
// 毫秒时间转化日日期格式
function unixToDate(unixTime, fmt) {
    var time = new Date(unixTime);
    return formatDate(time, fmt);
}
function formatDate(date, fmt) {
    var o = {
        "M+": date.getMonth() + 1, //月份 
        "d+": date.getDate(), //日 
        "h+": date.getHours(), //小时 
        "m+": date.getMinutes(), //分 
        "s+": date.getSeconds(), //秒 
        "q+": Math.floor((date.getMonth() + 3) / 3), //季度 
        "S": date.getMilliseconds() //毫秒 
    };
    if(!fmt) {
		fmt = "yyyy-MM-dd hh:mm:ss";
	}
    if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length));
    for (var k in o)
    if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
    return fmt;
}
//获取表单值
function getFormValues(form) {
	var elements = {};
	var element;
	var tagElements = form.getElementsByTagName('input');
	for(var j = 0; j < tagElements.length; j++) {
		element = tagElements[j];
		switch(element.type.toLowerCase()) {
			case 'checkbox':
			case 'radio':
				if(element.checked) {
					elements[element.name] = element.value;
				}
				break;
			case 'number':
				elements[element.name] = element.value - 0;
				break;
			default:
				elements[element.name] = element.value;
				break;
		}
	}
	tagElements = form.getElementsByTagName('select');
	for(var j = 0; j < tagElements.length; j++) {
		element = tagElements[j];
		elements[element.name] = element.value;
	}
	tagElements = form.getElementsByTagName('textarea');
	for(var j = 0; j < tagElements.length; j++) {
		element = tagElements[j];
		elements[element.name] = element.value;
	}
	return elements;
}
//设置表单值
function setFormValues(form, values) {
	var elements = {};
	var	element;
	var tagElements = form.getElementsByTagName('input');
	for(var j = 0; j < tagElements.length; j++) {
		element = tagElements[j];
		switch(element.type.toLowerCase()) {
			case 'checkbox':
				if(values[element.name]) {
					element.checked = 'checked';
				}
				break;
			case 'radio':
				if(element.value === values[element.name]){
					element.checked = 'checked';
				}
				break;
			case 'file':
				break;
			default:
				if(!isNull(values[element.name])) {
					element.value = values[element.name];
				}
				break;
		}
	}
	tagElements = form.getElementsByTagName('select');
	for(var j = 0; j < tagElements.length; j++) {
		element = tagElements[j];
		if(typeof values[element.name] != 'undefined') {
			element.value = values[element.name];
		}
	}
	tagElements = form.getElementsByTagName('textarea');
	for(var j = 0; j < tagElements.length; j++) {
		element = tagElements[j];
		if(typeof values[element.name] != 'undefined') {
			element.value = values[element.name];
		}
	}
}
//是否为空
function isNull(str) {
	return (/^\s*$/.test(str)) || (str == null) || (str === 'null') || (typeof str === 'undefined') || (str === 'undefined');
}
//获取URL参数
function getUrlParam(key){
	var reg = new RegExp("(^|&)" + key + "=([^&]*)(&|$)");
	var r = window.location.search.substr(1).match(reg);
	if(r != null) {
		return decodeURI(r[2]);
	} else {
		return null;
	}
}
/************* check选着框*************/
$$("#check").click(function(){
	$$(this).toggleClass('checkin');
	if($$(this).hasClass('checkin')) {
		$$("#creValid").hide();
		$$("#creValid").val("2099-12-31");
		$$(".applys").removeAttr("disabled");
	} else {
		$$("#creValid").show();
		$$("#creValid").val("");
		$$(".applys").attr("disabled","disabled");
	}
});
$$(".checkall").click(function(){
	$$(".checkall").toggleClass('checkallin');
});
/*************发送短信倒计时*************/
function Time(){
	var i = 179;
	var a = setInterval(function(){
		$$('#mobileNo').text(i+'S').attr('disabled','disabled');
		$$("#mobileNo").addClass("sendcodein");
		i--;
		if (i==1){
			i = 179;
			clearInterval(a);
			$$('#mobileNo').text('获取验证码').removeAttr('disabled');
			$$("#mobileNo").removeClass("sendcodein");
		}
	},1000)
}
function Timeval(num){
	var i = num;
	var a = setInterval(function(){
		$$('#sendcode').text(i+'S').attr('disabled','disabled');
		$$("#sendcode").addClass("sendcodein");
		i--;
		if (i==1){
			i = num;
			clearInterval(a);
			$$('#sendcode').text('获取验证码').removeAttr('disabled');
			$$("#sendcode").removeClass("sendcodein");
		}
	},1000)
}
/**********跳转倒计时*********/
function Time10(url){
	var i = 9;
	var a = setInterval(function(){
		$$('#sendcode').text(i);
		i--;
		if (i==0){
			i = 10;
			clearInterval(a);
			location.href = '../cash/'+url;
			$$('#sendcode').text('1');
			
		}
	},1000)
}
function _hide() {
	$$('.mui-popup-backdrop').hide();
	$$('.mui-popup').hide();
}
function _show() {
	$$('.mui-popup-backdrop').show();
	$$('.mui-popup').show();
}
/************* 验证身份证号码*************/
function checkcard(ID) {
    if(typeof ID !== 'string'){
    	msgs = '请填写正确的身份证号';
    	return false;
    }
    var city = {11:"北京",12:"天津",13:"河北",14:"山西",15:"内蒙古",21:"辽宁",22:"吉林",23:"黑龙江 ",31:"上海",32:"江苏",33:"浙江",34:"安徽",35:"福建",36:"江西",37:"山东",41:"河南",42:"湖北 ",43:"湖南",44:"广东",45:"广西",46:"海南",50:"重庆",51:"四川",52:"贵州",53:"云南",54:"西藏 ",61:"陕西",62:"甘肃",63:"青海",64:"宁夏",65:"新疆",71:"台湾",81:"香港",82:"澳门",91:"国外"};
    var birthday = ID.substr(6, 4) + '/' + Number(ID.substr(10, 2)) + '/' + Number(ID.substr(12, 2));
    var d = new Date(birthday);
    var newBirthday = d.getFullYear() + '/' + Number(d.getMonth() + 1) + '/' + Number(d.getDate());
    var currentTime = new Date().getTime();
    var time = d.getTime();
    var arrInt = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2];
    var arrCh = ['1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2'];
    var sum = 0, i, residue;
    if(!/^\d{17}(\d|x)$/i.test(ID)){
    	msgs = '请填写正确的身份证号';
    	return false;
    } 
    if(city[ID.substr(0,2)] === undefined){
    	msgs = '请填写正确的身份证号';
    	return false;
    }
    if(time >= currentTime || birthday !== newBirthday){
    	msgs = '请填写正确的身份证号';
    	return false;
    }
    for(i=0; i<17; i++) {
      sum += ID.substr(i, 1) * arrInt[i];
    }
    residue = arrCh[sum % 11];
    if (residue !== ID.substr(17, 1)){
    	msgs = '请填写正确的身份证号';
    	return false;
    }
	var sex = ID.substr(16,1)%2?"02":"01";
	
	var myDate = new Date();
    var month = myDate.getMonth() + 1;
    var day = myDate.getDate();
    var age = myDate.getFullYear() - ID.substring(6, 10) - 1;
    if (ID.substring(10, 12) < month || ID.substring(10, 12) == month && ID.substring(12, 14) <= day) {
        age++;
    }
    return true;
}
/*************验证手机号*************/
function checkPhone(phone){
	if(/^1[3|4|5|7|8|9][0-9]{9}$/.test(phone)) {
		return false;
	}else{
		return true;
	}
}


function getYear(sss){
	var sss=sss+"";
	return sss.substr(0,4)+"-"+sss.substr(4,2)+"-"+sss.substr(6,2);
}


function getData(sss){
	var sss=sss+"";
	return sss.substr(0,4)+"-"+sss.substr(4,2)+"-"+sss.substr(6,2) +" "+sss.substr(8,2)+":"+sss.substr(10,2)+":"+sss.substr(12,2);
}
function getTime(sss){
	var sss=sss+"";
	return sss.substr(8,2)+":"+sss.substr(10,2)+":"+sss.substr(12,2);
}

function getYYYYmmdd(sss){
	var sss=sss+"";
	return  sss.substr(0,10);
}


function getYYYYmm(sss){
	var sss=sss+"";
	return  sss.substr(5,5);
}



function  _error(){
	document.getElementsByClassName("mui-content")[0].innerHTML='<div class="mui-content"><div class="data">'
			+'<div class="data-icon icon-network"></div>'
			+'<p class="data-title gray">糟糕，好像出错了，请稍后再试！</p>'
			+'</div><div class="line"></div><div class="line"></div>'
			+'<div class="line"></div><div class="line"></div>'
			+'<div class="mui-text-center"><button type="button" class="mui-btn mui-btn-danger mui-btn-outlined" onclick="_reload()">刷新页面</button></div></div>';
}
function hide(){
	$$("#submit").remove();
    $$('body').removeAttr("style")
}
function show(val){
	if(isNull(val)){
		val = '正在加载';
	}
	$$('body').append('<div class="submit" id="submit"><div id="audio_btn" class="rotate"><p class="mui-text-center"><span class="mui-spinner"></span></p><p class="mui-text-center black mui-h6">'+val+'</p></div></div>');
	$$('body').css('overflow', 'hidden');
}
/** * *展开选项*************/
function _open(val,id){
	var data =$$(id);
	$$(data).toggleClass('on');
	if($$(data).hasClass('on')) {
		$$(".clo"+val).hide();
	} else {
		$$(".clo"+val).show();
	}
}
function _close(val){
	$(".clo"+val).hide();
	$("#clo"+val).removeAttr("onclick");
	$("#clo"+val).attr("onclick","_open("+val+")");
	$("#clo"+val+" span").attr("class","am-icon-angle-down am-icon-sm blue");
}

/******拨打电话*****/

/************************************************************************/
/************************************************************************/
/*******************************有图上传start***********************************/
//关闭
function _attachinfoBack(){
	$$("#attachinfoimg").remove();
}
//上传
function upload(id){
	_attachinfoBack();
	document.getElementById(id).click();
}
function _upload(id,event){
	var avatar = $$(event).css("backgroundImage");
	avatar = avatar.split("(")[1].split(")")[0];
	if(isNull(avatar.split("/images")[1])){
			$$('body').append('<div class="submit" id="attachinfoimg">'
							 +'<img alt="" src='+avatar+'>'
							 +'<span class="back " onclick="_attachinfoBack()">返回</span>'	
							 +'<span class="upd" attr-id="1" onclick="upload(\''+id+'\')">修改</span>'
							 +'</div>');
	}else{
		document.getElementById(id).click();
	}
}
/*******************************有图上传end***********************************/
/************************************************************************/
/************************************************************************/
/*******************************************基本信息民族****************************************************/
function natclose(){
	$$("#nat-mui-backdrop").remove();
	$$("#nat-mui-poppicker").remove();
	$$('body').css({ 
         "overflow-x":"auto",
         "overflow-y":"auto"        
    });
}
$$("#nationalityName").click(function(event){
	$$("#nat-mui-backdrop").show();
	$$("#nat-mui-poppicker").show();
	$$('body').append('<div class="mui-backdrop" style="opacity:1;" id="nat-mui-backdrop"></div>'
	+'<div class="mui-poppicker mui-active" id="nat-mui-poppicker">'
	+'<div class="mui-poppicker-header">'
	+'<button class="mui-btn mui-poppicker-btn-cancel mui-btn-link black"onclick="natclose()"></button>'
	+'<h1 class="poppicker-title">选择民族</h1>'
	+'<div class="mui-poppicker-clear"></div></div>'
    +'<div class="mui-poppicker-body mui-text-center" style="overflow-x: hidden;">'
	+'<div class="gray mui-input-group l5">热门</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="01">汉族</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="06">苗族</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="15">土家族</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="09">布依族</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="12">侗族 </div>'
	+'<div class="gray mui-input-group l5">A</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="39">阿昌族</div>'
	+'<div class="gray mui-input-group l5">B</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="47">保安族</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="34">布朗族</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="09">布依族</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="14">白族</div>'
	+'<div class="gray mui-input-group l5">C</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="10">朝鲜族</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="57">穿青人</div>'
	+'<div class="gray mui-input-group l5">D</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="46">德昂族</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="51">独龙族</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="31">达斡尔族</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="26">东乡族</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="12">侗族</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="18">傣族</div>'
	+'<div class="gray mui-input-group l5">E</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="44">俄罗斯族</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="45">鄂温克族</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="52">鄂伦春族</div>'
	+'<div class="gray mui-input-group l5">G</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="23">高山族</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="58">亻革家人</div>'
	+'<div class="gray mui-input-group l5">H</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="01">汉族</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="16">哈尼族</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="17">哈萨克族</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="03">回族</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="53">赫哲族</div>'
	+'<div class="gray mui-input-group l5">J</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="56">基诺族</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="28">景颇族</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="49">京族</div>'
	+'<div class="gray mui-input-group l5">K</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="29">柯尔克孜族</div>'
	+'<div class="gray mui-input-group l5">L</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="55">珞巴族</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="20">傈僳族</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="19">黎族</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="24">拉祜族</div>'
	+'<div class="gray mui-input-group l5">M</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="54">门巴族</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="02">蒙古族</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="36">毛南族</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="11">满族</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="123">苗族</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="59">摩梭人</div>'
	+'<div class="gray mui-input-group l5">N</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="32">仫佬族</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="27">纳西族</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="42">怒族</div>'
	+'<div class="gray mui-input-group l5">div</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="40">普米族</div>'
	+'<div class="gray mui-input-group l5">Q</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="33">羌族</div>'
	+'<div class="gray mui-input-group l5">S</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="35">撒拉族</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="25">水族</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="22">畲族</div>'
	+'<div class="gray mui-input-group l5">T</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="41">塔吉克族</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="15">土家族</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="50">塔塔尔族</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="30">土族</div>'
	+'<div class="gray mui-input-group l5">W</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="05">维吾尔族</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="43">乌孜别克族</div>'
	+'<div class="gray mui-input-group l5">X</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="38">锡伯族</div>'
	+'<div class="gray mui-input-group l5">Y</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="48">裕固族</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="07">彝族</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="13">瑶族</div>'
	+'<div class="gray mui-input-group l5">Z</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="37">仡佬族</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="22">佤族</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="04">藏族</div>'
	+'<div class="black mui-input-group l5" onclick="setNat(this)" data-value="08">壮族</div>'
	+'</div></div>');
	$$('body').css({ 
        "overflow-x":"hidden",
        "overflow-y":"hidden"       
    });
});
function setNat(id){
	$$("input[name='nationality']").val($$(id).attr("data-value"));
	$$("input[name='nationalityName']").val($$(id).html());
	$$("#nat-mui-backdrop").remove();
	$$("#nat-mui-poppicker").remove();
}
var u = navigator.userAgent;
var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
/****************************返回app首页***********************************/
function wv_close(){
	if(isAndroid){
		window.android.wv_close();
	}
	if(isiOS){
		wv_close();
	}
}
/***************************返回list页面*********************************/

$$('input[type="text"]').bind("click",function(e){
	if(!$$(this).attr("readonly")==="readonly"){
		if(isAndroid ||isiOS){
			$$(".bottom").hide();
		}
	}
}).bind("blur",function(e){
	if(isAndroid ||isiOS){
		$$(".bottom").show();
	}
});
$$('input[type="tel"]').bind("click",function(e){
	if(!$$(this).attr("readonly")==="readonly"){
		if(isAndroid ||isiOS){
			$$(".bottom").hide();
		}
	}
}).bind("blur",function(e){
	if(isAndroid ||isiOS){
		$$(".bottom").show();
	}
});

$$('input[type="password"]').bind("click",function(e){
	if(!$$(this).attr("readonly")==="readonly"){
		if(isAndroid ||isiOS){
			$$(".bottom").hide();
		}
	}
}).bind("blur",function(e){
	if(isAndroid ||isiOS){
		$$(".bottom").show();
	}
});
 function _reload(){
 	 window.location.reload();//刷新当前页面.
 }

/*调用原生login*/
function _login(){
	HH_WEB.hh_login();
}

/*调用原生设置*/
function _setting(){
	HH_WEB.hh_setting();
}

/*关闭webview*/
function _wvClose(){
	HH_WEB.hh_wvClose();
}

var phoneDatas;//通讯里  list
/*获取通讯录*/
function _getPhoneList(){
	HH_WEB.hh_getPhoneList();
}
/*app回调地址*/
function getPhoneData(phoneData){
	phoneDatas =  JSON.stringify(phoneData);
	phoneDatas = JSON.parse(phoneDatas);
	 setTimeout(function(){
	 	
	 	alert("isgrant----"+phoneDatas.isGrant+"contacts.length-------"+phoneDatas.contacts.length+"<br/>contacts[0]----"+phoneDatas.contacts[0].name+":"+phoneDatas.contacts[0].phone+"email:"+phoneDatas.contacts[0].email);
	 },1);
	
}


var AddrDatas;
/*获取地址*/
function _getAddr(){
	mui.toast("调用地址")
	HH_WEB.hh_getAddr();
}
/*app回调地址*/
function getAddrData(AddrData){
	AddrDatas =  JSON.stringify(AddrData);
	 AddrDatas = JSON.parse(AddrDatas)
	 setTimeout(function(){
	  	alert("longitude---"+AddrDatas.longitude+"latitude---"+AddrDatas.latitude+"address---"+AddrDatas.address);
	  },1);
	/*mui.toast("回调获取地址")
	 */
	//alert(AddrDatas.longitude);
}
/*银行卡暂不验证*/
function _tempNotVertify(){
	HH_WEB.hh_tempNotVertify();
}

/*网页出错*/
function hh_reload(){
	HH_WEB.hh_reload();
}
/* 首页亏安保*/
function hh_kab(){
	HH_WEB.hh_kab();
}
/* 客服*/
function hh_cs(){
	HH_WEB.hh_cs();
}

